<%@ Page Language="VB" EnableTheming="true" MasterPageFile="~/Default.master" AutoEventWireup="false" CodeFile="Post.aspx.vb" Inherits="Blogs_Post" title="Untitled Page" %>

<%@ Register Src="../Forum/ForumUser.ascx" TagName="ForumUser" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<%@ Register TagPrefix="sbk" Assembly="Subkismet" Namespace="Subkismet.Captcha" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div id="body">
<div class="fullwidth">
<a href="Default.aspx">All Blog Posts</a>
    <asp:ScriptManager id="ScriptManager1" runat="server">
    </asp:ScriptManager>
</div>

    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetPost"
        TypeName="ClubStarterKit.Web.Blogs">
        <SelectParameters>
            <asp:QueryStringParameter Name="postid" QueryStringField="id" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <br />
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="postid" DataSourceID="ObjectDataSource1">
        <ItemTemplate>
        <div id="columnleft">
        <div class="leftblock">
            <uc1:ForumUser ID="ForumUser1" runat="server" ShowAvatar="true" ShowBlogs="true" MemberID='<%# Eval("memid") %>' ShowBasicInfo="false" />
            </div>
        </div>
        <div id="columnright">
        <div class="rightblock">
            <asp:Label ID="TitleLabel" runat="server" Font-Bold="True" Font-Size="Large" Text='<%# Bind("Title") %>'></asp:Label><br />
            
            <asp:Hyperlink ID="memnameLabel" runat="server" Text='<%# ClubStarterKit.Web.Members.FirstAndLastName(Eval("memid")) %>' NavigateUrl='<%# "~/blogs/blogger.aspx?username=" & Membership.GetUser(Eval("memid")).Username() %>' />
            |
            <asp:Label ID="postdateLabel" runat="server" Text='<%# GetFriendlyDate(CDate(Eval("postdate")),True) %>'></asp:Label><br />
            <div class="dashedline">
                </div>
            <br />
            <asp:Label ID="TextLabel" runat="server" Text='<%# Bind("PostText") %>'></asp:Label><br />
            <br />
            <br />
            <Club:RolloverButton ID="HyperLink2" CausesValidation="false" Visible='<%#Isadmin %>' runat="server" Text="Delete Post" OnClick="HyperLink2_Click" />
            <cc1:ConfirmButtonExtender ConfirmText="Are you sure you want to delete this blog post?" ID="ConfirmButtonExtender1" runat="server" TargetControlID="HyperLink2">
            </cc1:ConfirmButtonExtender>
            </div>
        </div>
        </ItemTemplate>
    </asp:FormView>
    <br />

    <asp:UpdatePanel id="UpdatePanel1" UpdateMode="Conditional" runat="server">
        <contenttemplate>
        <asp:ObjectDataSource ID="CommentDS" runat="server" SelectMethod="GetPostComments" TypeName="ClubStarterKit.Web.Blogs">
            <SelectParameters>
                <asp:QueryStringParameter Name="postid" QueryStringField="id" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>
<DIV class="fullwidth"><H3>Comments </H3><P>&nbsp;&nbsp;</P><P><asp:Repeater id="Repeater1" runat="server" DataSourceID="CommentDS">
        <ItemTemplate>
        <table style="width: 688px">
            <tr>
                <td style="width: 17px">
                    <strong>Name</strong></td>
                <td style="width: 100px">
                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("Name") %>'></asp:Label></td>
            </tr>
            <tr>
                <td style="width: 17px">
                    <strong>Email</strong></td>
                <td style="width: 100px">
                    <asp:HyperLink ID="HyperLink1" Text='<%# Eval("Email") %>' NavigateUrl='<%# "mailto:" & Eval("Email").ToString %>' runat="server"></asp:HyperLink></td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("Comment") %>'></asp:Label>
                    <br />
                    <Club:RolloverLink ID="HyperLink2" CausesValidation="false" NavigateUrl='<%# "deletecomment.aspx?id=" & Eval("commentid").ToString %>' Visible='<%#Isadmin %>' runat="server" Text="Delete" />                    </td>
                        <cc1:ConfirmButtonExtender ConfirmText="Are you sure you want to delete this blog comment?" ID="ConfirmButtonExtender1" runat="server" TargetControlID="HyperLink2">
            </cc1:ConfirmButtonExtender>

            </tr>
        </table>
        <br />
        <br />
        </ItemTemplate>
        </asp:Repeater> </P>
        <asp:ImageButton runat="server" id="ImageButton1" skinid="rssbutton"></asp:ImageButton>
        </DIV><DIV id="addcommentdiv" class="fullwidth" runat="server"><H3>Add Comment </H3><P><STRONG>Comment </STRONG><BR /><asp:TextBox id="txtComment" runat="server" Height="65px" Width="587px"></asp:TextBox>&nbsp;<BR /><asp:RequiredFieldValidator id="RequiredFieldValidator3" runat="server" ToolTip="comment" ControlToValidate="txtComment" ErrorMessage="Enter a Comment"></asp:RequiredFieldValidator>
        
        <BR />
        <sbk:CaptchaControl id="captcha" 
    runat="server" 
    ErrorMessage="The NO BOT code you entered is invalid." 
    Display="dynamic"
    CaptchaLength="5"
    ValidationGroup="comment" />
        </P><Club:RolloverButton id="AddComment" runat="server" Text="Add Comment" ValidationGroup="comment" OnClick="AddComment_Click"></Club:RolloverButton> <BR /><BR />
         </DIV>
</contenttemplate>
    </asp:UpdatePanel><asp:UpdateProgress id="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"
        DisplayAfter="5"><progresstemplate>
<asp:Image ID="Image2" runat="server" SkinID="loading" />
</progresstemplate>
    </asp:UpdateProgress>
</div>
</asp:Content>

